import { BrowserRouter as Router,Routes,Route } from "react-router-dom";
import Home from '../views/Home'
import Musics from '../views/Musics/'
import Todolist from '../views/Todolist'
import Hot from '../views/Hot'
import Todo from '../views/todo'
const routes =[
    {
        path:"/",
        element:<Home/>
    },
    {
        path:"/musics",
        element:<Musics/>
    },
    {
        path:"/todolist",
        element:<Todolist/>
    },{
        path:"/hot",
        element:<Hot/>
    },
    {
        path:"/todo",
        element:<Todo/>
    }
]
function RouterView(){
    return (
        <Router>
            <Routes>
              {routes.map(item=>{
                  return (<Route path={item.path} key={item.path} element={item.element}></Route>)
              })}
            </Routes>
        </Router>
    )
}
export default RouterView

